package love.yuanmengrobot.als.business.dao.impl;/*
 *   @Studio:CHJY · 源梦科技
 *   @Author:zjj
 *   @Ide:IntelliJ IDEA
 *   @Creation time:2021/6/17 17:09
 */

import love.yuanmengrobot.als.business.dao.AwardDegreeDao;
import love.yuanmengrobot.als.utilPublic.JdbcUtil;
import love.yuanmengrobot.als.utilPublic.SqlString;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

public class AwardDegreeDaoImpl implements AwardDegreeDao {

    @Override
    public Float getAverageEnglish(String stuNo) {
        Connection conn = null;
        Statement stmt = null;
        ResultSet rs = null;
        try{
            conn= JdbcUtil.getConnection();
            stmt = conn.createStatement();
            rs=stmt.executeQuery(SqlString.selectAverageEnglish(stuNo));
            if(rs.next()){
                return rs.getFloat(1);
            }
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            JdbcUtil.close(rs,stmt,conn);
        }
        return null;
    }
}
